package com.sright.bcard.content.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.BetweenDateParamRequest;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.content.dal.dao.MaterialDAO;
import com.sright.bcard.content.dal.entity.MaterialDO;
import com.sright.bcard.content.dal.mapper.MaterialDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class MaterialDAOImpl extends BaseDAOImpl<MaterialDO> implements MaterialDAO {

    @Resource
    private MaterialDOMapper materialDOMapper;

    @Override
    public List<MaterialDO> selectByExample(MaterialDO materialDO) {
        return materialDOMapper.selectByExample(materialDO);
    }

    @Override
    public Integer deleteById(Long id) {
        return materialDOMapper.deleteById(id);
    }

    @Override
    public Integer count(List<Integer> materialType, BetweenDateParamRequest betweenDateParamRequest, Integer needReview) {
        return materialDOMapper.countByCondition(materialType, betweenDateParamRequest,needReview);
    }

    @Override
    public List<MaterialDO> pageList(List<Integer> materialType, BetweenDateParamRequest betweenDateParamRequest, PageParamRequest request, Integer needReview) {
        return materialDOMapper.selectByCondition(materialType, betweenDateParamRequest, request,needReview);
    }

    @Override
    public List<MaterialDO> selectByMaterialIdList(List<Long> materialIdList) {
        return materialDOMapper.selectByMaterialIdList(materialIdList);
    }

    @Override
    public List<MaterialDO> selectByEnterpriseId(Long enterpriseId) {
        return materialDOMapper.selectByEnterpriseId(enterpriseId);
    }

    @Override
    public List<MaterialDO> selectByMaterialIdAndType(List<Long> materialIdList, List<Integer> typeList) {
        return materialDOMapper.selectByMaterialIdAndType(materialIdList,typeList);
    }

    @Override
    public Integer selectCountByUserIdAndType(Long userId, Integer type) {
        return materialDOMapper.selectCountByUserIdAndType(userId,type);
    }

    @Override
    public List<MaterialDO> selectByUserIdAndType(Long userId,Integer type) {
        return materialDOMapper.selectByUserIdAndType(userId,type);
    }

    @Override
    public List<MaterialDO> page(MaterialDO materialDO) {
        return materialDOMapper.page(materialDO);
    }

    @Override
    public Integer pageCount(MaterialDO materialDO) {
        return materialDOMapper.pageCount(materialDO);
    }

    @Override
    public List<MaterialDO> selectByEnterpriseIdAndType(MaterialDO materialDO) {
        return materialDOMapper.selectByEnterpriseIdAndType(materialDO);
    }

    @Override
    public Integer countShareMaterial(BetweenDateParamRequest betweenDateParamRequest, Integer needReview) {
        return materialDOMapper.countShareMaterial(betweenDateParamRequest,needReview);
    }

    @Override
    public List<MaterialDO> shareMaterialList(BetweenDateParamRequest betweenDateParamRequest, PageParamRequest request, Integer needReview) {
        return materialDOMapper.shareMaterialList(betweenDateParamRequest,request,needReview);
    }

    @Override
    protected BaseMapper<MaterialDO> getObjMapper() {
        return materialDOMapper;
    }
}
